﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-12-12
Description:SoftType三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class SoftTypeService
	{
		 
	 
			
		public static int DeleteSoftTypeById(long id)	
		{     
            SoftType softType = new SoftType();
            softType.Id = id;
            EntityQuery<SoftType> query = new EntityQuery<SoftType>(softType);
             return query.Delete(softType);
		}	
        
          //以标识列获得对象
        public static SoftType GetSoftTypeById(long  id)
        {
            SoftType softType = new SoftType();
            softType.Id = id;
            EntityQuery<SoftType> query = new EntityQuery<SoftType>(softType);
            query.FillEntity(softType);
            return softType;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateSoftType(SoftType softType)
        {
            SoftType _softType = new SoftType();

            EntityQuery<SoftType> query = new EntityQuery<SoftType>(_softType);
           _softType= softType;
           int i=(softType.Id==0)?
                 query.Insert(_softType): query.Update(_softType);
            return i;
        }
		
		 
	}
}

